import axios from 'axios'

const baseUrl = 'http://localhost:8181/dormitoryAdmin'

const dormitoryAdminApi = {
  // 保存宿管信息
  saveDormitoryAdmin(data) {
    return axios.post(`${baseUrl}/save`, data)
  },
  
  // 获取宿管列表
  getDormitoryAdminList(page, size) {
    return axios.get(`${baseUrl}/list/${page}/${size}`)
  },
  
  // 搜索宿管
  searchDormitoryAdmin(params) {
    return axios.get(`${baseUrl}/search`, { params })
  },
  
  // 删除宿管
  deleteDormitoryAdmin(id) {
    return axios.delete(`${baseUrl}/deleteById/${id}`)
  },
  
  // 更新宿管信息
  updateDormitoryAdmin(data) {
    return axios.put(`${baseUrl}/update`, data)
  },
  
  // 获取单个宿管信息
  getDormitoryAdminById(id) {
    return axios.get(`${baseUrl}/findById/${id}`)
  }
}

export default dormitoryAdminApi